package edu.tfsu.team_2208.skylarkim.commons;

import lombok.Data;
import java.io.Serializable;

@Data
public class ResultData implements Serializable {

    private int code;
    private String msg;
    private Object data;

    public static ResultData success(Object data) {
        ResultData resultData = new ResultData();
        resultData.setCode(200);
        resultData.setMsg("success");
        resultData.setData(data);
        return resultData;
    }

    public static ResultData error(int code, String msg) {
        ResultData resultData = new ResultData();
        resultData.setCode(code);
        resultData.setMsg(msg);
        return resultData;
    }
}
